@openpresentation/opf 0.31.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.js +18 -18
  3. package/dist/{chart-data-Ci9s_NDN.d.ts → chart-data-oIZQlFGi.d.ts} +4 -2
  4. package/dist/{chunk-UKWNHK62.js → chunk-2E6CDYL2.js} +23 -6
  5. package/dist/{chunk-I6G32TB5.js → chunk-56J345KE.js} +5 -5
  6. package/dist/{chunk-XSCZZWYI.js → chunk-7U3TJBXE.js} +99 -15
  7. package/dist/{chunk-HRKV43GC.js → chunk-BBVW5ZC2.js} +3 -3
  8. package/dist/{chunk-7UO6H32I.js → chunk-CLRYHWQN.js} +162 -22
  9. package/dist/chunk-DGS47ONG.js +1 -0
  10. package/dist/{chunk-F5QC7E2O.js → chunk-F7DN33UL.js} +28 -8
  11. package/dist/{chunk-KELC4K62.js → chunk-HKUV7NEN.js} +1 -1
  12. package/dist/{chunk-XG4JKFZ6.js → chunk-IT7FQKED.js} +6 -6
  13. package/dist/{chunk-SYCHWS7C.js → chunk-J63CIRIV.js} +4 -4
  14. package/dist/{chunk-5Q4IYLMW.js → chunk-LEF4X4KI.js} +274 -33
  15. package/dist/{chunk-5OMZW44K.js → chunk-NEJ32O7X.js} +1 -1
  16. package/dist/chunk-NVAJASOD.js +14764 -0
  17. package/dist/{chunk-M7YZU3DX.js → chunk-OXLA4HXQ.js} +615 -58
  18. package/dist/{chunk-P5E3FNYO.js → chunk-PB7ME64J.js} +1 -1
  19. package/dist/{chunk-ARFAQNOH.js → chunk-SW676APJ.js} +2 -2
  20. package/dist/{chunk-W7KPMUJF.js → chunk-XFHXQCXL.js} +58 -5
  21. package/dist/{chunk-KOCXV7H3.js → chunk-XQO2CT6Q.js} +2 -2
  22. package/dist/{chunk-WHDOOLIO.js → chunk-YFJIIIOL.js} +3 -3
  23. package/dist/composition-DRqNGHJV.d.ts +5620 -0
  24. package/dist/composition.d.ts +2 -2
  25. package/dist/composition.js +1 -1
  26. package/dist/{conversion-Bh-skyMc.d.ts → conversion-Cadul8Mu.d.ts} +56 -9
  27. package/dist/conversion-J3YPDS7C.js +24 -0
  28. package/dist/convert.d.ts +2 -2
  29. package/dist/convert.js +7 -7
  30. package/dist/data.d.ts +2 -2
  31. package/dist/data.js +2 -2
  32. package/dist/{deck-report-DQMsvyBI.d.ts → deck-report-BA3IPJAV.d.ts} +2 -2
  33. package/dist/deck.d.ts +5 -5
  34. package/dist/deck.js +11 -11
  35. package/dist/diagram-engine-eager.js +6 -0
  36. package/dist/diagram-engine-lazy.js +2 -0
  37. package/dist/diff.js +4 -4
  38. package/dist/docs.js +25 -19
  39. package/dist/examples.js +4759 -995
  40. package/dist/format.js +2 -2
  41. package/dist/ids.js +4 -4
  42. package/dist/index.d.ts +15 -12
  43. package/dist/index.js +23 -22
  44. package/dist/markdown.d.ts +2 -2
  45. package/dist/markdown.js +8 -8
  46. package/dist/node-engine.d.ts +6 -6
  47. package/dist/node-engine.js +20 -20
  48. package/dist/{pagination-DyAKYpXu.d.ts → pagination-DwEkdJ6s.d.ts} +74 -4
  49. package/dist/pagination.d.ts +3 -3
  50. package/dist/pagination.js +4 -4
  51. package/dist/patch.js +3 -3
  52. package/dist/precompiled.js +2 -2
  53. package/dist/{presentation-8jLSTFqL.d.ts → presentation-DnD7mfmf.d.ts} +106 -27
  54. package/dist/repo-readme.js +1 -1
  55. package/dist/schema-engine-ajv.js +1 -1
  56. package/dist/schema-engine-precompiled.js +2 -2
  57. package/dist/schema.js +3 -3
  58. package/dist/schemas.d.ts +6 -0
  59. package/dist/schemas.js +1 -1
  60. package/dist/source.d.ts +4 -3
  61. package/dist/source.js +10 -10
  62. package/dist/spec/schemas/layout.schema.json +58 -8
  63. package/dist/spec/schemas/narrative.schema.json +2 -1
  64. package/dist/spec/schemas/opf.schema.json +122 -23
  65. package/dist/spec/schemas/theme.schema.json +9 -3
  66. package/dist/types.d.ts +69 -18
  67. package/dist/{validation-types-mNmfcY9A.d.ts → validation-types-vVah_PEv.d.ts} +1 -1
  68. package/dist/validator.d.ts +4 -4
  69. package/dist/validator.js +3 -3
  70. package/dist/yaml.d.ts +2 -2
  71. package/dist/yaml.js +7 -7
  72. package/package.json +15 -6
  73. package/dist/chunk-W3SEWSO5.js +0 -8043
  74. package/dist/chunk-ZROVYWGU.js +0 -1
  75. package/dist/composition-C-hd_Ci3.d.ts +0 -3207
  76. package/dist/conversion-7OPM5MMJ.js +0 -24
package/README.md CHANGED
@@ -89,7 +89,7 @@ The layout engine's names are not on the root. `composeSlide`, `fitText`, `layou
89
89
 
90
90
  ### Markdown and outlines
91
91
 
92
- `@openpresentation/opf/markdown` reads and writes a deck as Markdown in a small documented dialect (YAML front matter, `---` between slides, `#` title, `##` subtitle, lists, quotes, tables, images, `chart`, `metric` and `timeline` fences, `Note:` speaker notes). `fromMarkdown(markdown, { split, defaults, validate })` returns `{ presentation, valid, findings, counts }` with findings (the shared `Finding` format) that carry the line and column of the Markdown; `toMarkdown(presentation, { unsupported })` writes any valid deck, embedding what the dialect has no syntax for as YAML (or dropping it into `report.loss`), and the Markdown it writes converts back to the same deck. Deterministic and offline. Reads front matter with the `yaml` package. See the [Markdown guide](../../docs/markdown.md). Not in releases before the one that lists it in the changelog.
92
+ `@openpresentation/opf/markdown` reads and writes a deck as Markdown in a small documented dialect (YAML front matter, `---` between slides, `#` title, `##` subtitle, lists, quotes, tables, images, `chart`, `metric`, `timeline` and `mermaid` (diagram) fences, `Note:` speaker notes). `fromMarkdown(markdown, { split, defaults, validate })` returns `{ presentation, valid, findings, counts }` with findings (the shared `Finding` format) that carry the line and column of the Markdown; `toMarkdown(presentation, { unsupported })` writes any valid deck, embedding what the dialect has no syntax for as YAML (or dropping it into `report.loss`), and the Markdown it writes converts back to the same deck. Deterministic and offline. Reads front matter with the `yaml` package. See the [Markdown guide](../../docs/markdown.md). Not in releases before the one that lists it in the changelog.
93
93
 
94
94
  ### Reading and writing a deck in any form
95
95
 
package/dist/browser.js CHANGED
@@ -1,25 +1,25 @@
1
- import { OPFApiError } from './chunk-I6G32TB5.js';
2
- export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, edit, embed, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, stats, updateFromCatalog } from './chunk-I6G32TB5.js';
1
+ import { OPFApiError } from './chunk-56J345KE.js';
2
+ export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, edit, embed, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, stats, updateFromCatalog } from './chunk-56J345KE.js';
3
3
  export { specFileEntries, specFileKinds, specFilePaths } from './chunk-UJSAR6GF.js';
4
4
  export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-PJSPHHRK.js';
5
- export { OPFDataImportError, ingest, parseTabularData } from './chunk-P5E3FNYO.js';
6
- export { OPFPaginationError, paginate, paginateSlide } from './chunk-7UO6H32I.js';
7
- export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-SYCHWS7C.js';
8
- export { fromMarkdown, toMarkdown } from './chunk-F5QC7E2O.js';
9
- import './chunk-XG4JKFZ6.js';
10
- export { OPFFormatError, format } from './chunk-KELC4K62.js';
5
+ export { OPFDataImportError, ingest, parseTabularData } from './chunk-PB7ME64J.js';
6
+ export { OPFPaginationError, blockUnits, continuationPages, continueOverfull, paginate, paginateSlide } from './chunk-CLRYHWQN.js';
7
+ export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-J63CIRIV.js';
8
+ export { fromMarkdown, toMarkdown } from './chunk-F7DN33UL.js';
9
+ import './chunk-IT7FQKED.js';
10
+ export { OPFFormatError, format } from './chunk-HKUV7NEN.js';
11
11
  import './chunk-RYZPBJLB.js';
12
- export { explain } from './chunk-W7KPMUJF.js';
13
- import './chunk-UKWNHK62.js';
14
- import './chunk-5OMZW44K.js';
15
- export { OPFMarkdownError } from './chunk-HRKV43GC.js';
16
- import './chunk-KOCXV7H3.js';
17
- export { OPFIdError, assignIds, touches } from './chunk-ARFAQNOH.js';
18
- export { diff, merge } from './chunk-WHDOOLIO.js';
19
- export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFPatchError, OPFPatchHashError, OPFPatchValidationError, OPFValidationError, applyPatch, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, documentHash, findValidationRule, idToken, isIdToken, resolveDrawnFontFamilies, resolveIdPatch, resolveIdPointer, resolveSlideContext, toIdPatch, toIdPointer, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-M7YZU3DX.js';
12
+ export { explain } from './chunk-XFHXQCXL.js';
13
+ import './chunk-2E6CDYL2.js';
14
+ import './chunk-NEJ32O7X.js';
15
+ export { OPFMarkdownError } from './chunk-BBVW5ZC2.js';
16
+ import './chunk-XQO2CT6Q.js';
17
+ export { OPFIdError, assignIds, touches } from './chunk-SW676APJ.js';
18
+ export { diff, merge } from './chunk-YFJIIIOL.js';
19
+ export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFPatchError, OPFPatchHashError, OPFPatchValidationError, OPFValidationError, applyPatch, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, documentHash, findValidationRule, idToken, isIdToken, resolveDrawnFontFamilies, resolveIdPatch, resolveIdPointer, resolveSlideContext, toIdPatch, toIdPointer, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-OXLA4HXQ.js';
20
20
  import './chunk-JBARNYFR.js';
21
- export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-5Q4IYLMW.js';
22
- export { CATALOG_GROUP_PATTERN, CATALOG_REFERENCE_PATTERN, CHART_TYPES, DEFAULT_VARIABLE_DATE_FORMAT, ENGINE_DEFAULT_CHART_TYPES, ENGINE_DEFAULT_COLOR_SCHEME, ENGINE_DEFAULT_FONT_SCHEME, ENGINE_DEFAULT_THEME, LANGUAGES, LOGO_SHAPES, OPFCatalogsOptionError, OPFUnresolvedReferenceError, OPFVariableError, SLIDE_SCOPED_BUILTINS, SOCIAL_PLATFORMS, VARIABLE_KINDS, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, chartNumber, coerceVariableValue, datasetDiagnostics, formatDataNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isTemplate, isXYChartType, listBuiltinVariables, listVariables, normalizeLanguageFamily, numberFormatError, parseReference, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveReference, resolveSlideVariables, resolveTableData, resolveVariables, suggestChartNumberFix, tableCellDisplayValue, toExcelNumberFormat, unresolvedReference, unusedDatasets, variableDeclarations } from './chunk-W3SEWSO5.js';
21
+ export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-LEF4X4KI.js';
22
+ export { CATALOG_GROUP_PATTERN, CATALOG_REFERENCE_PATTERN, CHART_TYPES, DEFAULT_VARIABLE_DATE_FORMAT, ENGINE_DEFAULT_CHART_TYPES, ENGINE_DEFAULT_COLOR_SCHEME, ENGINE_DEFAULT_FONT_SCHEME, ENGINE_DEFAULT_THEME, LANGUAGES, LOGO_SHAPES, OPFCatalogsOptionError, OPFUnresolvedReferenceError, OPFVariableError, SLIDE_SCOPED_BUILTINS, SOCIAL_PLATFORMS, VARIABLE_KINDS, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, chartDrawDiagnostics, chartDrawPlan, chartNumber, coerceVariableValue, datasetDiagnostics, formatDataNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isPlaceLabel, isTemplate, isXYChartType, listBuiltinVariables, listVariables, markLabelColor, normalizeLanguageFamily, numberFormatError, parseReference, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveReference, resolveSlideVariables, resolveTableData, resolveVariables, suggestChartNumberFix, tableCellDisplayValue, toExcelNumberFormat, unresolvedReference, unusedDatasets, variableDeclarations } from './chunk-NVAJASOD.js';
23
23
  import './chunk-GM7WFPGG.js';
24
24
 
25
25
  // src/browser.ts
@@ -57,7 +57,7 @@ interface DataStyledCell {
57
57
  type DataTableCell = DataTableValue | DataStyledCell;
58
58
  /** A table column header: a cell, or a DataColumn. */
59
59
  type DataTableHeader = DataTableCell | DataColumn;
60
- type DataDiagnosticCode = 'chart-value-not-numeric' | 'dataset-unknown' | 'dataset-field-unknown' | 'data-column-duplicate' | 'chart-mapping-unknown-column' | 'chart-mapping-adapted' | 'chart-highlight-unknown-name' | 'chart-highlight-adapted' | 'number-format-invalid';
60
+ type DataDiagnosticCode = 'chart-value-not-numeric' | 'dataset-unknown' | 'dataset-field-unknown' | 'data-column-duplicate' | 'chart-mapping-unknown-column' | 'chart-mapping-adapted' | 'chart-highlight-unknown-name' | 'chart-highlight-adapted' | 'chart-series-dropped' | 'table-highlight-unknown-name' | 'number-format-invalid';
61
61
  interface DataDiagnostic {
62
62
  code: DataDiagnosticCode;
63
63
  severity: 'error' | 'warning';
@@ -182,8 +182,10 @@ interface ChartNumberFixOptions extends DataResolveOptions {
182
182
  declare function suggestChartNumberFix(chart: unknown, document?: unknown, options?: ChartNumberFixOptions): ChartNumberFix | undefined;
183
183
  /** Resolve a table (inline or dataset-backed) to headers, rows and per-column formats. */
184
184
  declare function resolveTableData(table: unknown, document?: unknown, options?: DataResolveOptions): ResolvedTableData;
185
+ /** LH-113: the text of a table cell as its key (the first column): a string, a number, rich runs or a styled cell's value. */
186
+ declare function tableKeyText(cell: unknown): string;
185
187
  /** Display value of a table cell: a number with a format (cell, else column) becomes formatted text; anything else is returned unchanged. */
186
188
  declare function tableCellDisplayValue(cell: DataTableCell, columnFormat?: string): DataTableCell;
187
189
 
188
- export { resolveChartData as A, resolveTableData as B, suggestChartNumberFix as E, tableCellDisplayValue as F, toExcelNumberFormat as G, unusedDatasets as H, chartNumber as q, datasetDiagnostics as r, formatDataNumber as s, fromExcelNumberFormat as t, inlineChartData as u, inlineDatasets as v, inlineTableData as w, isDatasetRef as x, isXYChartType as y, numberFormatError as z };
190
+ export { resolveChartData as A, resolveTableData as B, suggestChartNumberFix as E, tableCellDisplayValue as F, toExcelNumberFormat as G, unusedDatasets as H, tableKeyText as J, chartNumber as q, datasetDiagnostics as r, formatDataNumber as s, fromExcelNumberFormat as t, inlineChartData as u, inlineDatasets as v, inlineTableData as w, isDatasetRef as x, isXYChartType as y, numberFormatError as z };
189
191
  export type { ChartMapping as C, DataCellValue as D, ChartComboSeries as I, ResolvedChartData as R, ChartNumberFix as a, ChartNumberFixOperation as b, ChartNumberFixOptions as c, DataColumn as d, DataDiagnostic as e, DataDiagnosticCode as f, DataResolveOptions as g, DataSourceRef as h, DataStyledCell as i, DataTableCell as j, DataTableHeader as k, DataTableValue as l, DataTextRun as m, Dataset as n, DatasetRef as o, ResolvedTableData as p };
@@ -1,8 +1,8 @@
1
- import { parseQuoteLines, levelsFromIndents, parseCodeFence, splitWhen } from './chunk-5OMZW44K.js';
2
- import { Ctx, splitLines, lineRange, readYamlMapping, readCsv, DECIMAL } from './chunk-HRKV43GC.js';
3
- import { runText, isRecord, FORMATTING } from './chunk-KOCXV7H3.js';
4
- import { METRIC_KEYS, nearest, BLOCK_AS_VALUES, SLIDE_OPTION_KEYS, BLOCK_OPTION_KEYS } from './chunk-M7YZU3DX.js';
5
- import { PROMOTED_REGION_KEY } from './chunk-W3SEWSO5.js';
1
+ import { parseQuoteLines, levelsFromIndents, parseCodeFence, splitWhen } from './chunk-NEJ32O7X.js';
2
+ import { Ctx, splitLines, lineRange, readYamlMapping, readCsv, DECIMAL } from './chunk-BBVW5ZC2.js';
3
+ import { runText, isRecord, FORMATTING } from './chunk-XQO2CT6Q.js';
4
+ import { METRIC_KEYS, nearest, BLOCK_AS_VALUES, SLIDE_OPTION_KEYS, BLOCK_OPTION_KEYS } from './chunk-OXLA4HXQ.js';
5
+ import { PROMOTED_REGION_KEY } from './chunk-NVAJASOD.js';
6
6
 
7
7
  // src/markdown/inline.ts
8
8
  var PUNCT = /[\p{P}\p{S}]/u;
@@ -955,6 +955,7 @@ var SlideParser = class {
955
955
  if (word === "chart") this.chart(rest, bodyText, range);
956
956
  else if (word === "metric") this.metric(body, range);
957
957
  else if (word === "timeline") this.timeline(rest, body, range);
958
+ else if (word === "mermaid") this.diagram(rest, bodyText, range);
958
959
  else if (word === "opf-slide") this.embeddedSlide(bodyText, bodyStart, range);
959
960
  else if (word === "opf-block") this.embeddedBlock(bodyText, bodyStart, range);
960
961
  else {
@@ -970,6 +971,22 @@ var SlideParser = class {
970
971
  this.native("code", hasMeta ? value : parsed.source, range);
971
972
  }
972
973
  }
974
+ // A ```mermaid fence is a diagram payload; `alt="..."` after the word is its text alternative.
975
+ diagram(rest, text, range) {
976
+ const { ctx } = this;
977
+ const { pairs, error } = parseAttributes(rest);
978
+ let alt;
979
+ if (error) ctx.error("diagram-attributes", error, 'Write ```mermaid alt="What the diagram shows" (alt is optional).', range, this.path);
980
+ for (const [key, value] of pairs) {
981
+ if (key === "alt" && typeof value === "string") alt = value;
982
+ else ctx.error("diagram-attributes", `Unknown diagram attribute ${JSON.stringify(key)}.`, "A mermaid fence takes alt, a text alternative in double quotes.", range, this.path);
983
+ }
984
+ if (!text.trim()) {
985
+ ctx.error("diagram-source", "A mermaid block has no source.", "Write the Mermaid diagram between the fences, starting with its type (flowchart LR, sequenceDiagram, mindmap, ...).", range, this.path);
986
+ return;
987
+ }
988
+ this.native("diagram", alt === void 0 ? text : { source: text, alt }, range);
989
+ }
973
990
  chart(rest, text, range) {
974
991
  const { ctx } = this;
975
992
  const type = /^[^\s]+/.exec(rest)?.[0];
@@ -1164,7 +1181,7 @@ var SlideParser = class {
1164
1181
  return slide;
1165
1182
  }
1166
1183
  };
1167
- var CONTENT = /* @__PURE__ */ new Set(["text", "items", "bullets", "image", "video", "chart", "table", "code", "metric", "quote", "timeline"]);
1184
+ var CONTENT = /* @__PURE__ */ new Set(["text", "items", "bullets", "image", "video", "chart", "table", "code", "metric", "quote", "timeline", "diagram"]);
1168
1185
  var isContentKey = (key) => CONTENT.has(key);
1169
1186
  function splitRow(text) {
1170
1187
  let s = text.trim();
@@ -1,6 +1,6 @@
1
- import { OPFDataImportError, parseTabularData } from './chunk-P5E3FNYO.js';
2
- import { applyPatchWithInverse, validate, OPFValidationError } from './chunk-M7YZU3DX.js';
3
- import { embeddedCopy, checkCatalogsOption, catalogReferenceSites, parseReference, catalogGroupDeclared, resolveReference, dottedPath, unresolvedReference, recordReferenceSites, catalogGroupSource, registeredCatalog, catalogKinds, CATALOG_GROUP_PATTERN, isRecord, visitContentPayloads, annotationText, listVariables, resolveVariables, LOGO_SHAPES, resolveDesignRecords, resolveFontFamilies, resolveCanvasDimensions, imageBackground } from './chunk-W3SEWSO5.js';
1
+ import { OPFDataImportError, parseTabularData } from './chunk-PB7ME64J.js';
2
+ import { applyPatchWithInverse, validate, OPFValidationError } from './chunk-OXLA4HXQ.js';
3
+ import { embeddedCopy, checkCatalogsOption, catalogReferenceSites, parseReference, catalogGroupDeclared, resolveReference, dottedPath, unresolvedReference, recordReferenceSites, catalogGroupSource, registeredCatalog, catalogKinds, CATALOG_GROUP_PATTERN, isRecord, visitContentPayloads, annotationText, listVariables, resolveVariables, LOGO_SHAPES, resolveDesignRecords, resolveFontFamilies, resolveCanvasDimensions, imageBackground } from './chunk-NVAJASOD.js';
4
4
 
5
5
  // src/api-errors.ts
6
6
  var OPFApiError = class extends Error {
@@ -347,7 +347,7 @@ function moveToCustom(document, ref, options = {}) {
347
347
 
348
348
  // src/stats.ts
349
349
  var DEFAULT_WORDS_PER_MINUTE = 130;
350
- var KIND_ORDER = ["text", "items", "bullets", "quote", "metric", "code", "timeline", "chart", "table", "image", "video"];
350
+ var KIND_ORDER = ["text", "items", "bullets", "quote", "metric", "code", "timeline", "diagram", "chart", "table", "image", "video"];
351
351
  var FURNITURE_FIELDS = ["image", "text", "socials", "date"];
352
352
  var ZONES = ["left", "center", "right"];
353
353
  var WORD = /[\p{L}\p{N}\p{M}]+(?:['’.,-][\p{L}\p{N}\p{M}]+)*/gu;
@@ -572,7 +572,7 @@ function compute(presentation2, options, onFile) {
572
572
  };
573
573
  const datasetRecords = isRecord(deck.datasets) ? Object.entries(deck.datasets).filter(([, value]) => isRecord(value)) : [];
574
574
  const datasetUse = /* @__PURE__ */ new Map();
575
- const payloadCounts = { text: 0, items: 0, bullets: 0, quote: 0, metric: 0, code: 0, timeline: 0, chart: 0, table: 0, image: 0, video: 0, blocks: 0, regions: 0, groups: 0, maxDepth: 0 };
575
+ const payloadCounts = { text: 0, items: 0, bullets: 0, quote: 0, metric: 0, code: 0, timeline: 0, diagram: 0, chart: 0, table: 0, image: 0, video: 0, blocks: 0, regions: 0, groups: 0, maxDepth: 0 };
576
576
  const layouts = /* @__PURE__ */ new Map(), chartTypes = /* @__PURE__ */ new Map(), extensions = /* @__PURE__ */ new Set();
577
577
  const chartData = { inline: 0, dataset: 0, withSource: 0 };
578
578
  const tableItems = [];
@@ -1,8 +1,8 @@
1
1
  import { defaultCatalogs } from './chunk-AQEAZDL2.js';
2
- import { localAssetSources, OPFApiError, parseSlideSelection, OPFExportError, asApiError, OPFImportError } from './chunk-I6G32TB5.js';
3
- import { paginate } from './chunk-7UO6H32I.js';
4
- import { deckFormatOf, readDeckReport, stringify } from './chunk-SYCHWS7C.js';
5
- import { validate, OPFValidationError } from './chunk-M7YZU3DX.js';
2
+ import { localAssetSources, OPFApiError, parseSlideSelection, OPFExportError, asApiError, OPFImportError } from './chunk-56J345KE.js';
3
+ import { paginate, continueOverfull } from './chunk-CLRYHWQN.js';
4
+ import { deckFormatOf, readDeckReport, stringify } from './chunk-J63CIRIV.js';
5
+ import { validate, OPFValidationError } from './chunk-OXLA4HXQ.js';
6
6
  import { link, stat, readdir, lstat, readFile, open, unlink, mkdir, rename } from 'fs/promises';
7
7
  import path6 from 'path';
8
8
  import { readFileSync, statSync, realpathSync } from 'fs';
@@ -87,6 +87,12 @@ function createImageResolver(root, reporter, passDirectory = "pass --asset-dir")
87
87
  if ("problem" in outcome && outcome.problem === "blocked") reporter.add("cli", { code: "asset-blocked", path: context.path, message: `Image "${shown(source)}" was not read: ${outcome.reason}` });
88
88
  return null;
89
89
  },
90
+ /** LH-145: the same data URI as `forSvg` for `measurePictures`, without reporting a file that cannot be read (the draw does). */
91
+ forMeasure: (source) => {
92
+ if (!source) return null;
93
+ const outcome = read(source);
94
+ return "image" in outcome ? `data:${outcome.image.mediaType};base64,${Buffer.from(outcome.image.bytes).toString("base64")}` : null;
95
+ },
90
96
  /** opf-pptx: bytes and media type; null for URLs and references it handles itself. An unreadable local file throws asset-unresolved: opf-pptx before 0.24.1 stops the export, 0.24.1 and later leave the image out with a warning. */
91
97
  forPptx: (source, context) => {
92
98
  const outcome = read(source);
@@ -117,7 +123,7 @@ function localAssetProblems(deck, root) {
117
123
  }
118
124
  var RENDER_PACKAGE = "@openpresentation/opf-render";
119
125
  var PPTX_PACKAGE = "@openpresentation/opf-pptx";
120
- var PEER_RANGES = { [RENDER_PACKAGE]: "^0.31.0", [PPTX_PACKAGE]: "^0.31.0" };
126
+ var PEER_RANGES = { [RENDER_PACKAGE]: "^0.32.0", [PPTX_PACKAGE]: "^0.32.0" };
121
127
  var PPTX_TEXT_OPTIONS_FROM = "0.22.0";
122
128
  var numbers = (version) => version.replace(/[-+].*$/, "").split(".").map((part) => Number.parseInt(part, 10) || 0);
123
129
  function atLeast(version, minimum) {
@@ -129,6 +135,9 @@ function requirePptxOptions(pptx, options, flags = false) {
129
135
  const asked = [options.bodyText === "native" ? flags ? "--body-text native" : 'bodyText: "native"' : void 0, options.slideNumbers ? flags ? "--slide-numbers" : "slideNumbers" : void 0].filter(Boolean);
130
136
  if (asked.length && pptx.version !== "unknown" && !atLeast(pptx.version, PPTX_TEXT_OPTIONS_FROM))
131
137
  throw new OPFApiError(`${asked.join(" and ")} needs ${pptx.name}@${PPTX_TEXT_OPTIONS_FROM} or later; ${pptx.version} is installed and would ignore it.`, "peer-too-old", { details: { package: pptx.name } });
138
+ const newer = [options.typefaces === "safe" ? flags ? "--typefaces safe" : 'typefaces: "safe"' : void 0, options.as === "images" ? flags ? "--as images" : 'as: "images"' : void 0].filter(Boolean);
139
+ if (newer.length && typeof pptx.module?.typefacesNotOfficeSafe !== "function")
140
+ throw new OPFApiError(`${newer.join(" and ")} needs a newer ${pptx.name}; ${pptx.version} is installed and would ignore it.`, "peer-too-old", { details: { package: pptx.name } });
132
141
  }
133
142
  var RENDER_EXTRAS = {
134
143
  /** The faces of the office pack, which the CLI and `convert` always load (every format). */
@@ -451,15 +460,20 @@ var INFO = /* @__PURE__ */ new Set([
451
460
  "font-substituted",
452
461
  "pdf-font-embedded",
453
462
  "pdf-font-fallback",
454
- "svg-image-rasterized",
463
+ "export-lossy",
464
+ "typeface-not-office-safe",
465
+ "typeface-replaced",
455
466
  "svg-sanitized",
456
467
  "script-font-unavailable",
457
- "media-provenance-omitted"
468
+ "media-provenance-omitted",
469
+ "picture-not-measured"
458
470
  ]);
459
471
  var HELP = {
460
472
  "text-overflow": "Shorten the text, or split the slide: add --paginate (measured with the same fonts) or run opf paginate.",
461
473
  "small-cell": "Give the table more room or fewer columns, or run opf paginate.",
474
+ "slide-continued": "To keep one slide, shorten or remove blocks or choose a layout with more room. opf paginate writes the split into the deck; --keep-slides (paginate: false) draws the slide as written, overlapping.",
462
475
  "unresolved-asset": "Embed the image as a data URI, or keep the file inside the deck folder (see --asset-dir). URLs are never fetched.",
476
+ "picture-not-measured": "Check that the picture is a PNG, JPEG, GIF, WebP or SVG, and that the optional sharp peer is installed (npm install sharp). Until then the scrim under text on it is sized for any picture from black to white, which always reads.",
463
477
  "asset-blocked": "Move the file under the deck folder or pass --asset-dir <directory> that contains it.",
464
478
  "script-font-not-installed": "Install the Noto script package named in the message next to the CLI, then run the command again.",
465
479
  "font-glyph-fallback": "The chosen font lacks these characters; a bundled font draws them. Supply a font with --fonts to change that.",
@@ -472,6 +486,9 @@ var HELP = {
472
486
  "date-needs-value": "Pass --date YYYY-MM-DD. The CLI never reads a clock, so output stays reproducible.",
473
487
  "font-unavailable": "Pass --fonts with the font files, or choose a font the bundled pack covers (opf catalog fontSchemes).",
474
488
  "missing-glyph": "Install the script font package named by script-font-not-installed, or supply a covering font with --fonts.",
489
+ "export-lossy": "The PowerPoint file draws this with its nearest native form (see feature and the message). Change the content if the difference matters, or export with --as images for an exact picture.",
490
+ "typeface-not-office-safe": 'Export with --typefaces safe (typefaces: "safe") to write Office-safe families and lay the text out with them, or install the fonts on the machines that open the file.',
491
+ "typeface-replaced": "Drop --typefaces safe to keep the selected families in the file.",
475
492
  "duplicate-font-face": "A --fonts face repeats a bundled family, weight and style; remove it or rename the family."
476
493
  };
477
494
  var Reporter = class {
@@ -627,15 +644,19 @@ function resolveExportOptions(options) {
627
644
  const format = oneOf("format", options.format, EXPORT_FORMATS);
628
645
  if (!format) throw invalid("An export needs options.format: svg, png, pdf or pptx.");
629
646
  if (options.raster !== void 0 && typeof options.raster !== "boolean") throw invalid("raster must be true or false.");
647
+ if (options.paginate !== void 0 && typeof options.paginate !== "boolean" && options.paginate !== "blocks") throw invalid('paginate must be true, false or "blocks".');
630
648
  const charts = oneOf("charts", options.charts, ["auto", "native", "picture"]);
631
649
  const provenance = oneOf("provenance", options.provenance, ["full", "references-only", "none"]);
632
650
  const images = oneOf("images", options.images, ["compatible", "preserve"]);
633
651
  const bodyText = oneOf("bodyText", options.bodyText, ["measured", "native"]);
634
652
  const slideNumbers = oneOf("slideNumbers", options.slideNumbers, ["static", "live"]);
635
653
  const text = oneOf("text", options.text, EXPORT_TEXT);
654
+ const typefaces = oneOf("typefaces", options.typefaces, ["selected", "safe"]);
655
+ const as = oneOf("as", options.as, ["native", "images"]);
636
656
  if (options.raster && format !== "pdf") throw invalid("raster applies to format pdf.");
637
- if ((charts !== void 0 || provenance !== void 0 || images !== void 0 || bodyText !== void 0 || slideNumbers !== void 0) && format !== "pptx") throw invalid("charts, provenance, images, bodyText and slideNumbers apply to format pptx.");
638
- if (options.scale !== void 0 && format !== "png" && format !== "pdf") throw invalid("scale applies to format png (and raster pdf).");
657
+ if ((charts !== void 0 || provenance !== void 0 || images !== void 0 || bodyText !== void 0 || slideNumbers !== void 0 || typefaces !== void 0 || as !== void 0) && format !== "pptx") throw invalid("charts, provenance, images, bodyText, slideNumbers, typefaces and as apply to format pptx.");
658
+ if (as === "images" && (charts !== void 0 || provenance !== void 0 || images !== void 0 || bodyText !== void 0 || slideNumbers !== void 0 || typefaces !== void 0)) throw invalid('charts, provenance, images, bodyText, slideNumbers and typefaces do not apply to as: "images", where each slide is one picture.');
659
+ if (options.scale !== void 0 && format !== "png" && format !== "pdf" && !(format === "pptx" && as === "images")) throw invalid('scale applies to format png (and raster pdf, and pptx with as: "images").');
639
660
  if (options.includeHidden && format === "pptx") throw invalid("includeHidden applies to per-slide image and PDF output; the PPTX keeps a hidden slide as a hidden slide.");
640
661
  if (options.slides !== void 0 && format === "pptx") throw invalid("slides is not available for pptx: the whole presentation is exported.");
641
662
  if (text !== void 0 && format !== "svg") throw invalid("text applies to format svg.");
@@ -646,7 +667,7 @@ function resolveExportOptions(options) {
646
667
  const { fonts, ...rest } = options;
647
668
  if (fonts !== void 0 && typeof fonts !== "string" && !isHandle(fonts) && !(Array.isArray(fonts) && fonts.every((folder) => typeof folder === "string"))) throw invalid("fonts must be a fonts handle (loadFonts() of @openpresentation/opf-render/fonts-node), a folder of font files or a list of folders.");
648
669
  const folders = typeof fonts === "string" ? [fonts] : Array.isArray(fonts) ? [...fonts] : [];
649
- return { ...rest, format, text: text ?? "fonts", scale, ...isHandle(fonts) ? { fonts } : {}, fontFolders: folders };
670
+ return { ...rest, format, text: text ?? "fonts", scale, ...as === "images" ? { pictureScale: options.scale === void 0 ? 2 : scale } : {}, ...isHandle(fonts) ? { fonts } : {}, fontFolders: folders };
650
671
  }
651
672
  function assetRoot(directory, flags = false) {
652
673
  if (directory === void 0) return void 0;
@@ -696,7 +717,8 @@ async function drawWith(presentation, handle, options, ctx, environment) {
696
717
  ...handle.registry?.scriptSelection ? { scripts: handle.registry.scriptSelection } : {}
697
718
  });
698
719
  let pagination;
699
- if (options.paginate) {
720
+ let continued;
721
+ if (options.paginate === true) {
700
722
  try {
701
723
  const result = paginate(deck, { fonts: handle, catalogs });
702
724
  deck = result.presentation;
@@ -705,7 +727,34 @@ async function drawWith(presentation, handle, options, ctx, environment) {
705
727
  reportThrown(reporter, "render", error);
706
728
  return { files: [], fonts: fontSummary(), skippedHidden: [], failure: failureOf(error) };
707
729
  }
730
+ } else if (options.paginate !== false) {
731
+ const source = format === "pptx" ? "pptx" : "render";
732
+ try {
733
+ const result = continueOverfull(deck, { fonts: handle, catalogs, ...date ? { date } : {} });
734
+ if (result.continued.length) {
735
+ deck = result.presentation;
736
+ continued = result.continued.map((entry) => ({ slide: entry.sourceSlideIndex + 1, slides: entry.slideIndices.map((index) => index + 1), kind: entry.kind, blocks: entry.blocks.map((page) => page.length), units: entry.units }));
737
+ for (const entry of continued) {
738
+ const units = entry.units.reduce((sum, count) => sum + count, 0);
739
+ const blocks = entry.blocks.reduce((sum, count) => sum + count, 0);
740
+ const held = blocks === units ? `${units} ${entry.kind} blocks` : `${units} ${entry.kind} blocks with the ${blocks - units} blocks that follow them`;
741
+ reporter.add(source, {
742
+ code: "slide-continued",
743
+ path: `slides.${entry.slide - 1}`,
744
+ slides: entry.slides,
745
+ kind: entry.kind,
746
+ blocks: entry.blocks,
747
+ units: entry.units,
748
+ message: `Slide ${entry.slide} does not fit at the readability floor, so its ${held} are drawn on ${entry.slides.length} slides (${entry.slides.join(", ")}) with ${entry.units.join(", ")} ${entry.kind} blocks per slide, never splitting one; the deck has ${entry.slides.length - 1} more slide${entry.slides.length === 2 ? "" : "s"}.`
749
+ });
750
+ }
751
+ }
752
+ } catch (error) {
753
+ reportThrown(reporter, source, error);
754
+ return { files: [], fonts: fontSummary(), skippedHidden: [], failure: failureOf(error) };
755
+ }
708
756
  }
757
+ const pictureLuminance = options.measurePictures === false ? void 0 : await measurePictureBackgrounds(renderer, deck, resolver, catalogs, reporter);
709
758
  const slideCount = deck.slides?.length ?? 0;
710
759
  const isHidden = (number) => deck.slides?.[number - 1]?.hidden === true;
711
760
  const everySlide = Array.from({ length: slideCount }, (_, index) => index + 1);
@@ -716,11 +765,16 @@ async function drawWith(presentation, handle, options, ctx, environment) {
716
765
  if (format !== "pptx" && !selected.length)
717
766
  throw new OPFApiError(skippedHidden.length ? ctx.flags ? "Every slide is hidden. Use --include-hidden to write them, or --slides to name slides." : "Every slide is hidden. Use includeHidden to write them, or slides to name slides." : "The presentation has no slides.", skippedHidden.length ? "all-slides-hidden" : "no-slides");
718
767
  const stem = deckStem(options.name === void 0 ? deck : { filename: options.name }, "-");
719
- const run = (extra) => ({ fonts: fontSummary(), ...pagination ? { pagination } : {}, skippedHidden, ...extra });
768
+ const run = (extra) => ({ fonts: fontSummary(), ...pagination ? { pagination } : {}, ...continued ? { continued } : {}, skippedHidden, ...extra });
720
769
  try {
721
770
  if (format === "pptx") {
722
771
  requirePptxOptions(pptx, options, ctx.flags);
723
772
  const module = pptx.module;
773
+ const pictures = options.as === "images";
774
+ const slideRasterizer = async (picture, slide, size) => {
775
+ const svg = renderer.render.module.toSvg(picture, slide, { fonts: { textMeasurement: handle.textMeasurement, embeddedFonts: [] }, imageResolver: resolver.forSvg, onDiagnostic: (diagnostic) => reporter.add("render", diagnostic), catalogs, ...pictureLuminance ? { pictureLuminance } : {}, ...date ? { date } : {} });
776
+ return new Uint8Array(await renderer.render.module.toPng(svg, { fonts: handle, scale: size.scale }));
777
+ };
724
778
  const bytes = await module.toPptx(deck, {
725
779
  fonts: handle,
726
780
  imageResolver: resolver.forPptx,
@@ -729,14 +783,29 @@ async function drawWith(presentation, handle, options, ctx, environment) {
729
783
  svgRasterizer: async (svg, size) => new Uint8Array(await renderer.render.module.toPng(svg, { scale: size.scale, background: "rgba(0, 0, 0, 0)", fonts: size.text ? handle : NO_FONTS })),
730
784
  onDiagnostic: (diagnostic) => reporter.add("pptx", diagnostic),
731
785
  catalogs,
786
+ ...pictureLuminance ? { pictureLuminance } : {},
732
787
  // opf-pptx still names its option `chartex` and its picture choice `fallback`.
733
788
  ...options.charts ? { chartex: options.charts === "picture" ? "fallback" : options.charts } : {},
734
789
  ...options.provenance ? { provenance: options.provenance === "none" ? false : options.provenance } : {},
735
790
  ...options.images ? { imageFormat: options.images } : {},
736
791
  ...options.bodyText ? { bodyText: options.bodyText } : {},
737
792
  ...options.slideNumbers ? { slideNumberFields: options.slideNumbers } : {},
793
+ ...options.typefaces ? { typefaces: options.typefaces } : {},
794
+ ...pictures ? { as: "images", scale: options.pictureScale, slideRasterizer } : {},
738
795
  ...date ? { date } : {}
739
796
  });
797
+ const unsafe = pictures || options.typefaces === "safe" || typeof module.typefacesNotOfficeSafe !== "function" ? [] : module.typefacesNotOfficeSafe(bytes);
798
+ if (unsafe.length)
799
+ reporter.add(
800
+ "pptx",
801
+ {
802
+ code: "typeface-not-office-safe",
803
+ path: "",
804
+ families: unsafe,
805
+ message: `The PPTX names ${unsafe.join(", ")}, which ${unsafe.length === 1 ? "is" : "are"} not on every Windows and macOS machine or not measured exactly by OPF. A viewer without ${unsafe.length === 1 ? "it" : "them"} substitutes another font, and lines can break differently from the preview.`
806
+ },
807
+ "info"
808
+ );
740
809
  return run({ files: [{ name: `${stem}.pptx`, type: MEDIA2.pptx, bytes }], skippedHidden: [] });
741
810
  }
742
811
  const embedded = format === "svg" ? embeddedFor(handle, options.text) : [];
@@ -746,6 +815,7 @@ async function drawWith(presentation, handle, options, ctx, environment) {
746
815
  imageResolver: resolver.forSvg,
747
816
  onDiagnostic: (diagnostic) => reporter.add("render", diagnostic),
748
817
  catalogs,
818
+ ...pictureLuminance ? { pictureLuminance } : {},
749
819
  ...date ? { date } : {}
750
820
  };
751
821
  const svgs = [];
@@ -787,6 +857,17 @@ async function drawWith(presentation, handle, options, ctx, environment) {
787
857
  return { files: [], fonts: fontSummary(), ...pagination ? { pagination } : {}, skippedHidden: [], failure: failureOf(error) };
788
858
  }
789
859
  }
860
+ async function measurePictureBackgrounds(renderer, deck, resolver, catalogs, reporter) {
861
+ const measure = renderer.render.module.measurePictures;
862
+ if (typeof measure !== "function") return void 0;
863
+ try {
864
+ const sampler = await measure.call(renderer.render.module, deck, { imageResolver: resolver.forMeasure, catalogs, onDiagnostic: (diagnostic) => reporter.add("render", diagnostic, "info") });
865
+ return sampler.measured ? sampler : void 0;
866
+ } catch (error) {
867
+ reporter.add("render", { code: "picture-not-measured", path: "", message: `The pictures could not be measured, so every scrim is sized for any picture: ${error instanceof Error ? error.message : String(error)}` }, "info");
868
+ return void 0;
869
+ }
870
+ }
790
871
  var failureOf = (error) => {
791
872
  const failure = error;
792
873
  return { code: typeof failure?.code === "string" ? failure.code : "failed", message: failure?.message ?? String(error) };
@@ -844,6 +925,7 @@ async function runPreparedExport(prepared, presentation, checked) {
844
925
  fonts: run.fonts,
845
926
  skippedHidden: run.skippedHidden,
846
927
  ...run.pagination ? { pagination: run.pagination } : {},
928
+ ...run.continued ? { continued: run.continued } : {},
847
929
  ...run.pdf ? { pdf: run.pdf } : {},
848
930
  ...VERSIONS(renderer, pptx)
849
931
  };
@@ -915,7 +997,7 @@ function targetOf(output, options, flags) {
915
997
  checkOutputPattern(output, exported === "png" || exported === "svg");
916
998
  return exported ? { kind: "export", format: exported, zip: false } : { kind: "deck", format: deck };
917
999
  }
918
- var EXPORT_ONLY = ["slides", "includeHidden", "paginate", "scale", "raster", "text", "charts", "provenance", "images", "bodyText", "slideNumbers", "date", "fonts", "assetDir"];
1000
+ var EXPORT_ONLY = ["slides", "includeHidden", "paginate", "scale", "raster", "text", "charts", "provenance", "images", "bodyText", "slideNumbers", "typefaces", "as", "date", "fonts", "assetDir"];
919
1001
  var given = (value) => value !== void 0 && value !== false && !(Array.isArray(value) && value.length === 0);
920
1002
  function checkApplicable(source, target, options, flags) {
921
1003
  const name = (key) => flags ? `--${key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}` : key;
@@ -928,8 +1010,10 @@ function checkApplicable(source, target, options, flags) {
928
1010
  }
929
1011
  const format = target.format;
930
1012
  if (given(options.raster) && format !== "pdf") throw invalid2(`${name("raster")} applies to pdf output.`);
931
- if ((options.charts !== void 0 || options.provenance !== void 0 || options.images !== void 0 || options.bodyText !== void 0 || options.slideNumbers !== void 0) && format !== "pptx") throw invalid2(`${names("charts", "provenance", "images", "bodyText", "slideNumbers")} apply to pptx output.`);
932
- if (options.scale !== void 0 && format !== "png" && format !== "pdf") throw invalid2(`${name("scale")} applies to png output (and raster pdf).`);
1013
+ const pptxOnly = ["charts", "provenance", "images", "bodyText", "slideNumbers", "typefaces"].filter((key) => options[key] !== void 0);
1014
+ if ((pptxOnly.length || options.as !== void 0) && format !== "pptx") throw invalid2(`${names("charts", "provenance", "images", "bodyText", "slideNumbers", "typefaces", "as")} apply to pptx output.`);
1015
+ if (options.as === "images" && pptxOnly.length) throw invalid2(`${names(...pptxOnly)} ${pptxOnly.length === 1 ? "does" : "do"} not apply to ${flags ? "--as images" : 'as: "images"'}, where each slide is one picture.`);
1016
+ if (options.scale !== void 0 && format !== "png" && format !== "pdf" && !(format === "pptx" && options.as === "images")) throw invalid2(`${name("scale")} applies to png output (and raster pdf, and pptx ${flags ? "--as images" : 'with as: "images"'}).`);
933
1017
  if (given(options.includeHidden) && format === "pptx") throw invalid2(`${name("includeHidden")} applies to per-slide image and PDF output; the PPTX keeps a hidden slide as a hidden slide.`);
934
1018
  if (options.slides !== void 0 && format === "pptx") throw invalid2(`${name("slides")} is not available for pptx output: the whole presentation is exported.`);
935
1019
  if (options.text !== void 0 && format !== "svg") throw invalid2(`${name("text")} applies to svg output.`);
@@ -1,5 +1,5 @@
1
- import { isRecord, same } from './chunk-KOCXV7H3.js';
2
- import { createLocator } from './chunk-M7YZU3DX.js';
1
+ import { isRecord, same } from './chunk-XQO2CT6Q.js';
2
+ import { createLocator } from './chunk-OXLA4HXQ.js';
3
3
  import { parseDocument, isMap, isSeq, isScalar, YAMLMap, Scalar, stringify, visit } from 'yaml';
4
4
 
5
5
  var sentence = (text) => text.charAt(0).toUpperCase() + text.slice(1);
@@ -439,7 +439,7 @@ function describeYamlErrors(text, doc, errors, limit = 5) {
439
439
  }
440
440
  return out;
441
441
  }
442
- var SLIDE_KEYS = /* @__PURE__ */ new Set(["title", "subtitle", "items", "text", "layout", "blocks", "image", "chart", "table", "quote", "code", "metric", "timeline", "notes"]);
442
+ var SLIDE_KEYS = /* @__PURE__ */ new Set(["title", "subtitle", "items", "text", "layout", "blocks", "image", "chart", "table", "quote", "code", "metric", "timeline", "diagram", "notes"]);
443
443
  function analyzeYamlSyntax(text, options = {}) {
444
444
  const bom = text.startsWith("\uFEFF") ? 1 : 0;
445
445
  const body = text.slice(bom);